package uk.org.landeg.euler.problems.unported;
/** Euler problem 63 */

public class Euler063 extends AbstractProblem {
	// the nth power must be n digits long
	// number of digits in x^n is the integer part of n*log(x) + 1
	// so n = n*log(x) + 1
	//    n (1-lg(x)) = 1
	//    n = 1 / (1-lg(x))
	// specifically, n = 1 / (int)(1-lg(x))
	
	static int f (int n) {
		return (int)(1/ (1-Math.log10(n)));
	}

	@Override
	public String solve() {
		int sum = 0;
		for (int idx =0 ; idx < 10 ; idx++) {
			sum += f(idx);
			System.out.println(f(idx));
		}
		out.println(sum);
		return out.toString();
	}
}
